package operate;

public class operator2 {
    public static void main(String[] args) {
        int a = 10;
        a++;
        //++a,a++均为a=a+1
        System.out.println(a);


        a--;
        //--a,a--均为a=a-1
        System.out.println(a);
        //System.out.println(2++);自增自减只能变量

        int i = 10;
        int rs1 = ++i;
        System.out.println(rs1);
        System.out.println(i);
        int j = 10;
        int rs2 = j++;
        System.out.println(j);
        System.out.println(rs2);


        System.out.println("-----------------------------");
        int m = 5;
        int n = 3;
        //m 5 6 5 4
        //n 3  4 3
        //            6  - 5 + 5 - 4 + 4
        int result = ++m - --m + m-- - ++n +n-- +3;
        System.out.println(m);
        System.out.println(n);
        System.out.println(result);
    }
}
